package com.google.gson.internal.bind;

import com.google.gson.b.a;
import com.google.gson.b.d;
import java.io.IOException;

class n extends TypeAdapter {
    private TypeAdapter a;

    n() {
    }

    public void a(d dVar, Object obj) throws IOException {
        if (this.a == null) {
            throw new IllegalStateException();
        }
        this.a.a(dVar, obj);
    }

    public void a(TypeAdapter typeAdapter) {
        if (this.a != null) {
            throw new AssertionError();
        }
        this.a = typeAdapter;
    }

    public Object b(a aVar) throws IOException {
        if (this.a != null) {
            return this.a.b(aVar);
        }
        throw new IllegalStateException();
    }
}
